package com.volunteer.controller;

import com.volunteer.service.BaiDuMapService;
import com.volunteer.util.Result;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author willow
 * @version v.0.1
 * @date 2018年09月15日
 */

@RestController
@RequestMapping("/baiduMap")  // 通过这里配置使下面的映射都在/baiduMap下
public class BaiDuMapController {
    @Autowired
    private BaiDuMapService baiDuMapService;

    @ApiOperation(value = "ip定位")
    @ApiImplicitParam(name = "ipAddress", value = "ip地址", required = true, dataType = "String")
    @GetMapping(value = "/ipPositioning")
    public Result ipPositioning(@RequestParam("ipAddress") String ipAddress) {
        return baiDuMapService.ipPositioning(ipAddress);
    }
}
